From b33bb1e4d9e834d1ca3b7341b8ceedc347f31a57 Mon Sep 17 00:00:00 2001 From: Ewan Mellor Date: Tue, 27 Feb 2007 01:05:32 +0000 Subject: [PATCH] Implementation of host_metrics.get_all, PIF_metrics.get_all, and docs and bindings for many of the get_all methods elsewhere that Xend already implemented. Signed-off-by: Ewan Mellor --- docs/xen-api/xenapi-datamodel.tex | 273 ++++++++++++++++++++ tools/libxen/include/xen_console.h | 7 + tools/libxen/include/xen_host_cpu.h | 7 + tools/libxen/include/xen_host_metrics.h | 9 +- tools/libxen/include/xen_pbd.h | 9 +- tools/libxen/include/xen_pif.h | 9 +- tools/libxen/include/xen_pif_metrics.h | 9 +- tools/libxen/include/xen_vbd.h | 7 + tools/libxen/include/xen_vbd_metrics.h | 7 + tools/libxen/include/xen_vdi.h | 7 + tools/libxen/include/xen_vif.h | 7 + tools/libxen/include/xen_vif_metrics.h | 7 + tools/libxen/include/xen_vm_guest_metrics.h | 7 + tools/libxen/include/xen_vm_metrics.h | 7 + tools/libxen/src/xen_console.c | 12 + tools/libxen/src/xen_host_cpu.c | 12 + tools/libxen/src/xen_host_metrics.c | 14 +- tools/libxen/src/xen_pbd.c | 14 +- tools/libxen/src/xen_pif.c | 14 +- tools/libxen/src/xen_pif_metrics.c | 14 +- tools/libxen/src/xen_vbd.c | 12 + tools/libxen/src/xen_vbd_metrics.c | 12 + tools/libxen/src/xen_vdi.c | 12 + tools/libxen/src/xen_vif.c | 12 + tools/libxen/src/xen_vif_metrics.c | 12 + tools/libxen/src/xen_vm_guest_metrics.c | 12 + tools/libxen/src/xen_vm_metrics.c | 12 + tools/python/xen/xend/XendAPI.py | 6 + 28 files changed, 534 insertions(+), 8 deletions(-) diff --git a/docs/xen-api/xenapi-datamodel.tex b/docs/xen-api/xenapi-datamodel.tex index 4c07eaadf0..0d85fbdba2 100644 --- a/docs/xen-api/xenapi-datamodel.tex +++ b/docs/xen-api/xenapi-datamodel.tex @@ -4248,6 +4248,27 @@ $\mathit{RO}_\mathit{run}$ & {\tt VCPUs/utilisation} & (int $\rightarrow$ float \hline \end{longtable} \subsection{Additional RPCs associated with class: VM\_metrics} +\subsubsection{RPC name:~get\_all} + +{\bf Overview:} +Return a list of all the VM\_metrics instances known to the system. + + \noindent {\bf Signature:} +\begin{verbatim} ((VM_metrics ref) Set) get_all (session_id s)\end{verbatim} + + +\vspace{0.3cm} + + \noindent {\bf Return Type:} +{\tt +(VM\_metrics ref) Set +} + + +references to all objects +\vspace{0.3cm} +\vspace{0.3cm} +\vspace{0.3cm} \subsubsection{RPC name:~get\_uuid} {\bf Overview:} @@ -4464,6 +4485,27 @@ $\mathit{RO}_\mathit{run}$ & {\tt other} & (string $\rightarrow$ string) Map & \hline \end{longtable} \subsection{Additional RPCs associated with class: VM\_guest\_metrics} +\subsubsection{RPC name:~get\_all} + +{\bf Overview:} +Return a list of all the VM\_guest\_metrics instances known to the system. + + \noindent {\bf Signature:} +\begin{verbatim} ((VM_guest_metrics ref) Set) get_all (session_id s)\end{verbatim} + + +\vspace{0.3cm} + + \noindent {\bf Return Type:} +{\tt +(VM\_guest\_metrics ref) Set +} + + +references to all objects +\vspace{0.3cm} +\vspace{0.3cm} +\vspace{0.3cm} \subsubsection{RPC name:~get\_uuid} {\bf Overview:} @@ -6073,6 +6115,27 @@ $\mathit{RO}_\mathit{run}$ & {\tt memory/free} & int & Host's free memory (byte \hline \end{longtable} \subsection{Additional RPCs associated with class: host\_metrics} +\subsubsection{RPC name:~get\_all} + +{\bf Overview:} +Return a list of all the host\_metrics instances known to the system. + + \noindent {\bf Signature:} +\begin{verbatim} ((host_metrics ref) Set) get_all (session_id s)\end{verbatim} + + +\vspace{0.3cm} + + \noindent {\bf Return Type:} +{\tt +(host\_metrics ref) Set +} + + +references to all objects +\vspace{0.3cm} +\vspace{0.3cm} +\vspace{0.3cm} \subsubsection{RPC name:~get\_uuid} {\bf Overview:} @@ -6289,6 +6352,27 @@ $\mathit{RO}_\mathit{run}$ & {\tt utilisation} & float & the current CPU utilis \hline \end{longtable} \subsection{Additional RPCs associated with class: host\_cpu} +\subsubsection{RPC name:~get\_all} + +{\bf Overview:} +Return a list of all the host\_cpus known to the system. + + \noindent {\bf Signature:} +\begin{verbatim} ((host_cpu ref) Set) get_all (session_id s)\end{verbatim} + + +\vspace{0.3cm} + + \noindent {\bf Return Type:} +{\tt +(host\_cpu ref) Set +} + + +references to all objects +\vspace{0.3cm} +\vspace{0.3cm} +\vspace{0.3cm} \subsubsection{RPC name:~get\_uuid} {\bf Overview:} @@ -7100,6 +7184,27 @@ $\mathit{RO}_\mathit{run}$ & {\tt metrics} & VIF\_metrics ref & metrics associa \hline \end{longtable} \subsection{Additional RPCs associated with class: VIF} +\subsubsection{RPC name:~get\_all} + +{\bf Overview:} +Return a list of all the VIFs known to the system. + + \noindent {\bf Signature:} +\begin{verbatim} ((VIF ref) Set) get_all (session_id s)\end{verbatim} + + +\vspace{0.3cm} + + \noindent {\bf Return Type:} +{\tt +(VIF ref) Set +} + + +references to all objects +\vspace{0.3cm} +\vspace{0.3cm} +\vspace{0.3cm} \subsubsection{RPC name:~get\_uuid} {\bf Overview:} @@ -7906,6 +8011,27 @@ $\mathit{RO}_\mathit{run}$ & {\tt io/write\_kbs} & float & Write bandwidth (KiB \hline \end{longtable} \subsection{Additional RPCs associated with class: VIF\_metrics} +\subsubsection{RPC name:~get\_all} + +{\bf Overview:} +Return a list of all the VIF\_metrics instances known to the system. + + \noindent {\bf Signature:} +\begin{verbatim} ((VIF_metrics ref) Set) get_all (session_id s)\end{verbatim} + + +\vspace{0.3cm} + + \noindent {\bf Return Type:} +{\tt +(VIF\_metrics ref) Set +} + + +references to all objects +\vspace{0.3cm} +\vspace{0.3cm} +\vspace{0.3cm} \subsubsection{RPC name:~get\_uuid} {\bf Overview:} @@ -8166,6 +8292,27 @@ void \noindent{\bf Possible Error Codes:} {\tt PIF\_IS\_PHYSICAL} \vspace{0.6cm} +\subsubsection{RPC name:~get\_all} + +{\bf Overview:} +Return a list of all the PIFs known to the system. + + \noindent {\bf Signature:} +\begin{verbatim} ((PIF ref) Set) get_all (session_id s)\end{verbatim} + + +\vspace{0.3cm} + + \noindent {\bf Return Type:} +{\tt +(PIF ref) Set +} + + +references to all objects +\vspace{0.3cm} +\vspace{0.3cm} +\vspace{0.3cm} \subsubsection{RPC name:~get\_uuid} {\bf Overview:} @@ -8642,6 +8789,27 @@ $\mathit{RO}_\mathit{run}$ & {\tt io/write\_kbs} & float & Write bandwidth (KiB \hline \end{longtable} \subsection{Additional RPCs associated with class: PIF\_metrics} +\subsubsection{RPC name:~get\_all} + +{\bf Overview:} +Return a list of all the PIF\_metrics instances known to the system. + + \noindent {\bf Signature:} +\begin{verbatim} ((PIF_metrics ref) Set) get_all (session_id s)\end{verbatim} + + +\vspace{0.3cm} + + \noindent {\bf Return Type:} +{\tt +(PIF\_metrics ref) Set +} + + +references to all objects +\vspace{0.3cm} +\vspace{0.3cm} +\vspace{0.3cm} \subsubsection{RPC name:~get\_uuid} {\bf Overview:} @@ -9558,6 +9726,27 @@ void +\vspace{0.3cm} +\vspace{0.3cm} +\vspace{0.3cm} +\subsubsection{RPC name:~get\_all} + +{\bf Overview:} +Return a list of all the VDIs known to the system. + + \noindent {\bf Signature:} +\begin{verbatim} ((VDI ref) Set) get_all (session_id s)\end{verbatim} + + +\vspace{0.3cm} + + \noindent {\bf Return Type:} +{\tt +(VDI ref) Set +} + + +references to all objects \vspace{0.3cm} \vspace{0.3cm} \vspace{0.3cm} @@ -10371,6 +10560,27 @@ void +\vspace{0.3cm} +\vspace{0.3cm} +\vspace{0.3cm} +\subsubsection{RPC name:~get\_all} + +{\bf Overview:} +Return a list of all the VBDs known to the system. + + \noindent {\bf Signature:} +\begin{verbatim} ((VBD ref) Set) get_all (session_id s)\end{verbatim} + + +\vspace{0.3cm} + + \noindent {\bf Return Type:} +{\tt +(VBD ref) Set +} + + +references to all objects \vspace{0.3cm} \vspace{0.3cm} \vspace{0.3cm} @@ -11246,6 +11456,27 @@ $\mathit{RO}_\mathit{run}$ & {\tt io/write\_kbs} & float & Write bandwidth (KiB \hline \end{longtable} \subsection{Additional RPCs associated with class: VBD\_metrics} +\subsubsection{RPC name:~get\_all} + +{\bf Overview:} +Return a list of all the VBD\_metrics instances known to the system. + + \noindent {\bf Signature:} +\begin{verbatim} ((VBD_metrics ref) Set) get_all (session_id s)\end{verbatim} + + +\vspace{0.3cm} + + \noindent {\bf Return Type:} +{\tt +(VBD\_metrics ref) Set +} + + +references to all objects +\vspace{0.3cm} +\vspace{0.3cm} +\vspace{0.3cm} \subsubsection{RPC name:~get\_uuid} {\bf Overview:} @@ -11427,6 +11658,27 @@ $\mathit{RO}_\mathit{run}$ & {\tt currently\_attached} & bool & is the SR curre \hline \end{longtable} \subsection{Additional RPCs associated with class: PBD} +\subsubsection{RPC name:~get\_all} + +{\bf Overview:} +Return a list of all the PBDs known to the system. + + \noindent {\bf Signature:} +\begin{verbatim} ((PBD ref) Set) get_all (session_id s)\end{verbatim} + + +\vspace{0.3cm} + + \noindent {\bf Return Type:} +{\tt +(PBD ref) Set +} + + +references to all objects +\vspace{0.3cm} +\vspace{0.3cm} +\vspace{0.3cm} \subsubsection{RPC name:~get\_uuid} {\bf Overview:} @@ -12243,6 +12495,27 @@ $\mathit{RW}$ & {\tt other\_config} & (string $\rightarrow$ string) Map & addit \hline \end{longtable} \subsection{Additional RPCs associated with class: console} +\subsubsection{RPC name:~get\_all} + +{\bf Overview:} +Return a list of all the consoles known to the system. + + \noindent {\bf Signature:} +\begin{verbatim} ((console ref) Set) get_all (session_id s)\end{verbatim} + + +\vspace{0.3cm} + + \noindent {\bf Return Type:} +{\tt +(console ref) Set +} + + +references to all objects +\vspace{0.3cm} +\vspace{0.3cm} +\vspace{0.3cm} \subsubsection{RPC name:~get\_uuid} {\bf Overview:} diff --git a/tools/libxen/include/xen_console.h b/tools/libxen/include/xen_console.h index ca4721c49d..5402ae9fbe 100644 --- a/tools/libxen/include/xen_console.h +++ b/tools/libxen/include/xen_console.h @@ -237,4 +237,11 @@ extern bool xen_console_remove_from_other_config(xen_session *session, xen_console console, char *key); +/** + * Return a list of all the consoles known to the system. + */ +extern bool +xen_console_get_all(xen_session *session, struct xen_console_set **result); + + #endif diff --git a/tools/libxen/include/xen_host_cpu.h b/tools/libxen/include/xen_host_cpu.h index f70023f24e..8b6d37f5e3 100644 --- a/tools/libxen/include/xen_host_cpu.h +++ b/tools/libxen/include/xen_host_cpu.h @@ -229,4 +229,11 @@ extern bool xen_host_cpu_get_utilisation(xen_session *session, double *result, xen_host_cpu host_cpu); +/** + * Return a list of all the host_cpus known to the system. + */ +extern bool +xen_host_cpu_get_all(xen_session *session, struct xen_host_cpu_set **result); + + #endif diff --git a/tools/libxen/include/xen_host_metrics.h b/tools/libxen/include/xen_host_metrics.h index 6ee609a9e9..37a6469e10 100644 --- a/tools/libxen/include/xen_host_metrics.h +++ b/tools/libxen/include/xen_host_metrics.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, XenSource Inc. + * Copyright (c) 2006-2007, XenSource Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -190,4 +190,11 @@ extern bool xen_host_metrics_get_memory_free(xen_session *session, int64_t *result, xen_host_metrics host_metrics); +/** + * Return a list of all the host_metrics instances known to the system. + */ +extern bool +xen_host_metrics_get_all(xen_session *session, struct xen_host_metrics_set **result); + + #endif diff --git a/tools/libxen/include/xen_pbd.h b/tools/libxen/include/xen_pbd.h index 6d0f6b449e..335d20b2ff 100644 --- a/tools/libxen/include/xen_pbd.h +++ b/tools/libxen/include/xen_pbd.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, XenSource Inc. + * Copyright (c) 2006-2007, XenSource Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -213,4 +213,11 @@ extern bool xen_pbd_get_currently_attached(xen_session *session, bool *result, xen_pbd pbd); +/** + * Return a list of all the PBDs known to the system. + */ +extern bool +xen_pbd_get_all(xen_session *session, struct xen_pbd_set **result); + + #endif diff --git a/tools/libxen/include/xen_pif.h b/tools/libxen/include/xen_pif.h index a4d6db7420..63fc88477b 100644 --- a/tools/libxen/include/xen_pif.h +++ b/tools/libxen/include/xen_pif.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, XenSource Inc. + * Copyright (c) 2006-2007, XenSource Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -267,4 +267,11 @@ extern bool xen_pif_destroy(xen_session *session, xen_pif self); +/** + * Return a list of all the PIFs known to the system. + */ +extern bool +xen_pif_get_all(xen_session *session, struct xen_pif_set **result); + + #endif diff --git a/tools/libxen/include/xen_pif_metrics.h b/tools/libxen/include/xen_pif_metrics.h index 420516d8b6..9d49bc8c1d 100644 --- a/tools/libxen/include/xen_pif_metrics.h +++ b/tools/libxen/include/xen_pif_metrics.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, XenSource Inc. + * Copyright (c) 2006-2007, XenSource Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -189,4 +189,11 @@ extern bool xen_pif_metrics_get_io_write_kbs(xen_session *session, double *result, xen_pif_metrics pif_metrics); +/** + * Return a list of all the PIF_metrics instances known to the system. + */ +extern bool +xen_pif_metrics_get_all(xen_session *session, struct xen_pif_metrics_set **result); + + #endif diff --git a/tools/libxen/include/xen_vbd.h b/tools/libxen/include/xen_vbd.h index e3cd7e4500..86ad38f207 100644 --- a/tools/libxen/include/xen_vbd.h +++ b/tools/libxen/include/xen_vbd.h @@ -357,4 +357,11 @@ extern bool xen_vbd_media_change(xen_session *session, xen_vbd vbd, xen_vdi vdi); +/** + * Return a list of all the VBDs known to the system. + */ +extern bool +xen_vbd_get_all(xen_session *session, struct xen_vbd_set **result); + + #endif diff --git a/tools/libxen/include/xen_vbd_metrics.h b/tools/libxen/include/xen_vbd_metrics.h index 8b3c1429d4..3cd507b31e 100644 --- a/tools/libxen/include/xen_vbd_metrics.h +++ b/tools/libxen/include/xen_vbd_metrics.h @@ -180,4 +180,11 @@ extern bool xen_vbd_metrics_get_io_write_kbs(xen_session *session, double *result, xen_vbd_metrics vbd_metrics); +/** + * Return a list of all the VBD_metrics instances known to the system. + */ +extern bool +xen_vbd_metrics_get_all(xen_session *session, struct xen_vbd_metrics_set **result); + + #endif diff --git a/tools/libxen/include/xen_vdi.h b/tools/libxen/include/xen_vdi.h index 8533df31a8..90120370d5 100644 --- a/tools/libxen/include/xen_vdi.h +++ b/tools/libxen/include/xen_vdi.h @@ -335,4 +335,11 @@ extern bool xen_vdi_resize(xen_session *session, xen_vdi vdi, int64_t size); +/** + * Return a list of all the VDIs known to the system. + */ +extern bool +xen_vdi_get_all(xen_session *session, struct xen_vdi_set **result); + + #endif diff --git a/tools/libxen/include/xen_vif.h b/tools/libxen/include/xen_vif.h index 6ef2ebdbea..05a070aff4 100644 --- a/tools/libxen/include/xen_vif.h +++ b/tools/libxen/include/xen_vif.h @@ -331,4 +331,11 @@ extern bool xen_vif_remove_from_qos_algorithm_params(xen_session *session, xen_vif vif, char *key); +/** + * Return a list of all the VIFs known to the system. + */ +extern bool +xen_vif_get_all(xen_session *session, struct xen_vif_set **result); + + #endif diff --git a/tools/libxen/include/xen_vif_metrics.h b/tools/libxen/include/xen_vif_metrics.h index 2b150d0a68..b5a26f25c6 100644 --- a/tools/libxen/include/xen_vif_metrics.h +++ b/tools/libxen/include/xen_vif_metrics.h @@ -180,4 +180,11 @@ extern bool xen_vif_metrics_get_io_write_kbs(xen_session *session, double *result, xen_vif_metrics vif_metrics); +/** + * Return a list of all the VIF_metrics instances known to the system. + */ +extern bool +xen_vif_metrics_get_all(xen_session *session, struct xen_vif_metrics_set **result); + + #endif diff --git a/tools/libxen/include/xen_vm_guest_metrics.h b/tools/libxen/include/xen_vm_guest_metrics.h index 61c6c090ea..fd328594df 100644 --- a/tools/libxen/include/xen_vm_guest_metrics.h +++ b/tools/libxen/include/xen_vm_guest_metrics.h @@ -224,4 +224,11 @@ extern bool xen_vm_guest_metrics_get_other(xen_session *session, xen_string_string_map **result, xen_vm_guest_metrics vm_guest_metrics); +/** + * Return a list of all the VM_guest_metrics instances known to the system. + */ +extern bool +xen_vm_guest_metrics_get_all(xen_session *session, struct xen_vm_guest_metrics_set **result); + + #endif diff --git a/tools/libxen/include/xen_vm_metrics.h b/tools/libxen/include/xen_vm_metrics.h index e3b06c214b..b03c4d4e3c 100644 --- a/tools/libxen/include/xen_vm_metrics.h +++ b/tools/libxen/include/xen_vm_metrics.h @@ -189,4 +189,11 @@ extern bool xen_vm_metrics_get_vcpus_utilisation(xen_session *session, xen_int_float_map **result, xen_vm_metrics vm_metrics); +/** + * Return a list of all the VM_metrics instances known to the system. + */ +extern bool +xen_vm_metrics_get_all(xen_session *session, struct xen_vm_metrics_set **result); + + #endif diff --git a/tools/libxen/src/xen_console.c b/tools/libxen/src/xen_console.c index 0f61fdde6f..a5a5ad2bb2 100644 --- a/tools/libxen/src/xen_console.c +++ b/tools/libxen/src/xen_console.c @@ -269,6 +269,18 @@ xen_console_remove_from_other_config(xen_session *session, xen_console console, } +bool +xen_console_get_all(xen_session *session, struct xen_console_set **result) +{ + + abstract_type result_type = abstract_type_string_set; + + *result = NULL; + xen_call_(session, "console.get_all", NULL, 0, &result_type, result); + return session->ok; +} + + bool xen_console_get_uuid(xen_session *session, char **result, xen_console console) { diff --git a/tools/libxen/src/xen_host_cpu.c b/tools/libxen/src/xen_host_cpu.c index 425d0c60b9..1494c10191 100644 --- a/tools/libxen/src/xen_host_cpu.c +++ b/tools/libxen/src/xen_host_cpu.c @@ -267,6 +267,18 @@ xen_host_cpu_get_utilisation(xen_session *session, double *result, xen_host_cpu } +bool +xen_host_cpu_get_all(xen_session *session, struct xen_host_cpu_set **result) +{ + + abstract_type result_type = abstract_type_string_set; + + *result = NULL; + xen_call_(session, "host_cpu.get_all", NULL, 0, &result_type, result); + return session->ok; +} + + bool xen_host_cpu_get_uuid(xen_session *session, char **result, xen_host_cpu host_cpu) { diff --git a/tools/libxen/src/xen_host_metrics.c b/tools/libxen/src/xen_host_metrics.c index 910ca229ec..c54270bd23 100644 --- a/tools/libxen/src/xen_host_metrics.c +++ b/tools/libxen/src/xen_host_metrics.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, XenSource Inc. + * Copyright (c) 2006-2007, XenSource Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -164,6 +164,18 @@ xen_host_metrics_get_memory_free(xen_session *session, int64_t *result, xen_host } +bool +xen_host_metrics_get_all(xen_session *session, struct xen_host_metrics_set **result) +{ + + abstract_type result_type = abstract_type_string_set; + + *result = NULL; + xen_call_(session, "host_metrics.get_all", NULL, 0, &result_type, result); + return session->ok; +} + + bool xen_host_metrics_get_uuid(xen_session *session, char **result, xen_host_metrics host_metrics) { diff --git a/tools/libxen/src/xen_pbd.c b/tools/libxen/src/xen_pbd.c index cb7ac9df72..1bdcd785fa 100644 --- a/tools/libxen/src/xen_pbd.c +++ b/tools/libxen/src/xen_pbd.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, XenSource Inc. + * Copyright (c) 2006-2007, XenSource Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -220,6 +220,18 @@ xen_pbd_get_currently_attached(xen_session *session, bool *result, xen_pbd pbd) } +bool +xen_pbd_get_all(xen_session *session, struct xen_pbd_set **result) +{ + + abstract_type result_type = abstract_type_string_set; + + *result = NULL; + xen_call_(session, "PBD.get_all", NULL, 0, &result_type, result); + return session->ok; +} + + bool xen_pbd_get_uuid(xen_session *session, char **result, xen_pbd pbd) { diff --git a/tools/libxen/src/xen_pif.c b/tools/libxen/src/xen_pif.c index 0e9af6a382..f710acef4b 100644 --- a/tools/libxen/src/xen_pif.c +++ b/tools/libxen/src/xen_pif.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, XenSource Inc. + * Copyright (c) 2006-2007, XenSource Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -351,6 +351,18 @@ xen_pif_destroy(xen_session *session, xen_pif self) } +bool +xen_pif_get_all(xen_session *session, struct xen_pif_set **result) +{ + + abstract_type result_type = abstract_type_string_set; + + *result = NULL; + xen_call_(session, "PIF.get_all", NULL, 0, &result_type, result); + return session->ok; +} + + bool xen_pif_get_uuid(xen_session *session, char **result, xen_pif pif) { diff --git a/tools/libxen/src/xen_pif_metrics.c b/tools/libxen/src/xen_pif_metrics.c index 3f09ae7dc1..1b30e1293e 100644 --- a/tools/libxen/src/xen_pif_metrics.c +++ b/tools/libxen/src/xen_pif_metrics.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, XenSource Inc. + * Copyright (c) 2006-2007, XenSource Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -164,6 +164,18 @@ xen_pif_metrics_get_io_write_kbs(xen_session *session, double *result, xen_pif_m } +bool +xen_pif_metrics_get_all(xen_session *session, struct xen_pif_metrics_set **result) +{ + + abstract_type result_type = abstract_type_string_set; + + *result = NULL; + xen_call_(session, "PIF_metrics.get_all", NULL, 0, &result_type, result); + return session->ok; +} + + bool xen_pif_metrics_get_uuid(xen_session *session, char **result, xen_pif_metrics pif_metrics) { diff --git a/tools/libxen/src/xen_vbd.c b/tools/libxen/src/xen_vbd.c index 4d396b88f7..def7403ef9 100644 --- a/tools/libxen/src/xen_vbd.c +++ b/tools/libxen/src/xen_vbd.c @@ -551,6 +551,18 @@ xen_vbd_media_change(xen_session *session, xen_vbd vbd, xen_vdi vdi) } +bool +xen_vbd_get_all(xen_session *session, struct xen_vbd_set **result) +{ + + abstract_type result_type = abstract_type_string_set; + + *result = NULL; + xen_call_(session, "VBD.get_all", NULL, 0, &result_type, result); + return session->ok; +} + + bool xen_vbd_get_uuid(xen_session *session, char **result, xen_vbd vbd) { diff --git a/tools/libxen/src/xen_vbd_metrics.c b/tools/libxen/src/xen_vbd_metrics.c index f2f51506df..985553d5a0 100644 --- a/tools/libxen/src/xen_vbd_metrics.c +++ b/tools/libxen/src/xen_vbd_metrics.c @@ -142,6 +142,18 @@ xen_vbd_metrics_get_io_write_kbs(xen_session *session, double *result, xen_vbd_m } +bool +xen_vbd_metrics_get_all(xen_session *session, struct xen_vbd_metrics_set **result) +{ + + abstract_type result_type = abstract_type_string_set; + + *result = NULL; + xen_call_(session, "VBD_metrics.get_all", NULL, 0, &result_type, result); + return session->ok; +} + + bool xen_vbd_metrics_get_uuid(xen_session *session, char **result, xen_vbd_metrics vbd_metrics) { diff --git a/tools/libxen/src/xen_vdi.c b/tools/libxen/src/xen_vdi.c index 005425ebc1..150d341b1b 100644 --- a/tools/libxen/src/xen_vdi.c +++ b/tools/libxen/src/xen_vdi.c @@ -506,6 +506,18 @@ xen_vdi_resize(xen_session *session, xen_vdi vdi, int64_t size) } +bool +xen_vdi_get_all(xen_session *session, struct xen_vdi_set **result) +{ + + abstract_type result_type = abstract_type_string_set; + + *result = NULL; + xen_call_(session, "VDI.get_all", NULL, 0, &result_type, result); + return session->ok; +} + + bool xen_vdi_get_uuid(xen_session *session, char **result, xen_vdi vdi) { diff --git a/tools/libxen/src/xen_vif.c b/tools/libxen/src/xen_vif.c index 74d67ea9d4..11cba1dcbd 100644 --- a/tools/libxen/src/xen_vif.c +++ b/tools/libxen/src/xen_vif.c @@ -499,6 +499,18 @@ xen_vif_remove_from_qos_algorithm_params(xen_session *session, xen_vif vif, char } +bool +xen_vif_get_all(xen_session *session, struct xen_vif_set **result) +{ + + abstract_type result_type = abstract_type_string_set; + + *result = NULL; + xen_call_(session, "VIF.get_all", NULL, 0, &result_type, result); + return session->ok; +} + + bool xen_vif_get_uuid(xen_session *session, char **result, xen_vif vif) { diff --git a/tools/libxen/src/xen_vif_metrics.c b/tools/libxen/src/xen_vif_metrics.c index 1f43993024..78707b36f5 100644 --- a/tools/libxen/src/xen_vif_metrics.c +++ b/tools/libxen/src/xen_vif_metrics.c @@ -142,6 +142,18 @@ xen_vif_metrics_get_io_write_kbs(xen_session *session, double *result, xen_vif_m } +bool +xen_vif_metrics_get_all(xen_session *session, struct xen_vif_metrics_set **result) +{ + + abstract_type result_type = abstract_type_string_set; + + *result = NULL; + xen_call_(session, "VIF_metrics.get_all", NULL, 0, &result_type, result); + return session->ok; +} + + bool xen_vif_metrics_get_uuid(xen_session *session, char **result, xen_vif_metrics vif_metrics) { diff --git a/tools/libxen/src/xen_vm_guest_metrics.c b/tools/libxen/src/xen_vm_guest_metrics.c index 44c9fabe97..80f4390af9 100644 --- a/tools/libxen/src/xen_vm_guest_metrics.c +++ b/tools/libxen/src/xen_vm_guest_metrics.c @@ -253,6 +253,18 @@ xen_vm_guest_metrics_get_other(xen_session *session, xen_string_string_map **res } +bool +xen_vm_guest_metrics_get_all(xen_session *session, struct xen_vm_guest_metrics_set **result) +{ + + abstract_type result_type = abstract_type_string_set; + + *result = NULL; + xen_call_(session, "VM_guest_metrics.get_all", NULL, 0, &result_type, result); + return session->ok; +} + + bool xen_vm_guest_metrics_get_uuid(xen_session *session, char **result, xen_vm_guest_metrics vm_guest_metrics) { diff --git a/tools/libxen/src/xen_vm_metrics.c b/tools/libxen/src/xen_vm_metrics.c index 6f5e95166e..9bafa83aa0 100644 --- a/tools/libxen/src/xen_vm_metrics.c +++ b/tools/libxen/src/xen_vm_metrics.c @@ -164,6 +164,18 @@ xen_vm_metrics_get_vcpus_utilisation(xen_session *session, xen_int_float_map **r } +bool +xen_vm_metrics_get_all(xen_session *session, struct xen_vm_metrics_set **result) +{ + + abstract_type result_type = abstract_type_string_set; + + *result = NULL; + xen_call_(session, "VM_metrics.get_all", NULL, 0, &result_type, result); + return session->ok; +} + + bool xen_vm_metrics_get_uuid(xen_session *session, char **result, xen_vm_metrics vm_metrics) { diff --git a/tools/python/xen/xend/XendAPI.py b/tools/python/xen/xend/XendAPI.py index 3562ba45f0..843ac800c6 100644 --- a/tools/python/xen/xend/XendAPI.py +++ b/tools/python/xen/xend/XendAPI.py @@ -807,6 +807,9 @@ class XendAPI(object): host_metrics_attr_rw = [] host_metrics_methods = [] + def host_metrics_get_all(self, _): + return xen_api_success([XendNode.instance().host_metrics_uuid]) + def _host_metrics_get(self, ref, f): return xen_api_success(getattr(node, f)()) @@ -971,6 +974,9 @@ class XendAPI(object): PIF_metrics_attr_rw = [] PIF_methods = [] + def PIF_metrics_get_all(self, _): + return xen_api_success(XendNode.instance().pif_metrics.keys()) + def _PIF_metrics_get(self, ref): return XendNode.instance().pif_metrics[ref] -- 2.30.2